<?php

namespace wechat\controllers;

use tt\assets\MarkdownAsset;
use ttcommon\aop\annotation\ControllerAnnotation;
use ttext\backend\admin\hook\QuickMenuHook;

/**
 * @title [微信]帮助文档
 * @access public
 */
class HelpController extends BaseWechatController implements ControllerAnnotation
{
    /**
     * @title 帮助菜单
     * @return string
     */
    public function actionIndex()
    {
        return $this->render('index');
    }

    public function actionFor($type)
    {
        QuickMenuHook::$disabled = true;
        $this->addAssetBundle(MarkdownAsset::class);
        return $this->render('md', [
            'type' => $type
        ]);
    }

    public static function help()
    {
        return [
            'desc' => '简介：负责微信平台的接入操作',
            'name' => 'wechat', // 模块的名称
            'titles' => [
                ['config', '配置'],
            ]
        ];
    }
}